﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Wsitech.BLL;

public partial class News_NewsList : System.Web.UI.Page
{
    protected readonly string sitemapid = HttpContext.Current.Request["sitemapid"] ?? "";
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            AspNetPager1.PageSize = 10;
            bindNews();
        }
    }

    private void bindNews()
    {
        int count = 0;
        repMain.DataSource = TextInfoBLL.Instance.GetActivePagedListBySiteMapID(sitemapid, AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize, ref count);
        repMain.DataBind();

        AspNetPager1.RecordCount = count;
    }

    //换页
    protected void AspNetPager1_PageChanged(object sender, EventArgs e)
    {
        bindNews();
    }
}